<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Default</title>
</head>
<body>
    <!--顶部导航-->
    <div class="topNav" th:fragment="topNav(username,account)">
        <span class="sysName">问卷系统</span>
        <span class="userAccount" th:text="${username}"></span>
        <span class="userName" th:text="${account}"></span>
        <img class="userHead" th:src="@{/asserts/img/icon-user-1.png}">
    </div>

    <!--侧边导航-->
    <nav class="leftNav" th:fragment="leftNav(chose,userType)">
        <div class="leftNav_title">
            <img class="img_icon" th:src="@{/asserts/img/home.png}"> Home
        </div>
        <div class="leftNav_block">
            <div id="MyQuestion" th:class="${chose}=='MyQuestion'?'chose_active':''">
                <img class="img_icon" th:src="@{/asserts/img/myquestion.png}"> 我的问卷
            </div>
            <div id="AddQuestion" th:class="${chose}=='AddQuestion'?'chose_active':''">
                <img class="img_icon" th:src="@{/asserts/img/addquestion.png}"> 发布问卷
            </div>
            <div id="CheckQuestionForm" th:class="${chose}=='CheckQuestionForm'?'chose_active':''">
                <img class="img_icon" th:src="@{/asserts/img/questionForm.png}"> 问卷表单
            </div>
        </div>
        <div class="leftNav_title" th:if="${userType} eq 'Teacher'">
            <img class="img_icon" th:src="@{/asserts/img/manager.png}"> Manage
        </div>
        <div class="leftNav_block" th:if="${userType} eq 'Teacher'">
            <div id="AuditForm" th:class="${chose}=='TeacherAuditForm'?'chose_active':''">
                <img class="img_icon" th:src="@{/asserts/img/auditForm.png}"> 审核问卷
            </div>
        </div>
    </nav>

    <script th:inline="javascript" th:fragment="linklist(userType)">
        $("#MyQuestion").click(function () {
            window.location.href = [[${"/"+userType+"Home?page=1"}]];
        });
        $("#AddQuestion").click(function () {
            window.location.href = [[${"/"+userType+"AddQuestion"}]];
        });
        $("#CheckQuestionForm").click(function () {
            window.location.href = [[${"/"+userType+"CheckForm?page=1"}]];
        });
    </script>
</body>
</html>